<?php
ini_set('memory_limit', '100M');
if (isset($_FILES['f'])) {
    if (strtolower(substr($_FILES['f']['name'],-4))!='.xls') die("none excel file\n");
    $tmpXls = tempnam("/tmp", "xls");
    move_uploaded_file($_FILES['f']['tmp_name'], $tmpXls);
    $convert = dirname(__FILE__).'/xls2csv.pl';
    `$convert $tmpXls $tmpXls.csv 1`;
    echo "<pre>".file_get_contents("$tmpXls.csv")."</pre>";
    unlink($tmpXls);unlink("$tmpXls.csv");
}
?>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="f" /> <input type="submit" />
</form>
